#!/bin/sh

#Variables
ENV=/srv/etc/stock/environment.stock

#Before we begin, lets make sure everything is in place.
/srv/sbin/sysreq.sh

#If everything is in place, start with changing the system path.
#Back it up first
cp -p /etc/environment /srv/etc/stock/environment.stock
	
	#Confirm we backed up the original before appending the original.
	if [ -f $ENV ];
	then
		echo "$ENV exists, proceeding."
	else
		echo "$ENV does not exist.";exit 0
	fi 
#If all is clear, add the path to /etc/environment.
	cat /srv/etc/stock/environment.stock > /srv/tmp/environment.modify
	##Remove stupid quotes from PATH.
	sed -i 's/\"//g' /srv/tmp/environment.modify
	sed 's/$/:\/srv\/bin:\/srv\/sbin:\/srv\/local\/bin:\/srv\/local\/sbin/g' /srv/tmp/environment.modify > /etc/environment
